﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAO_ADMIN;
using System.Data.SqlClient;
using PTTK19.DB;
namespace PTTK19.GUI
{
    public partial class CapNhatMonAnFrm : Form
    {
        public CapNhatMonAnFrm()
        {
            InitializeComponent();
        }
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            int _MaMonAn = int.Parse(txtMaMonAn.Text);
            string _TenMonAn = txtTenMonAn.Text;
            string _CachCheBien = txtCachCheBien.Text;
            List<SqlParameter> parr = new List<SqlParameter>();
            string procname = "sp_CapNhatMonAn";
            parr.Add(new SqlParameter("@MaMonAn", _MaMonAn));
            parr.Add(new SqlParameter("@TenMonAn", _TenMonAn));
            parr.Add(new SqlParameter("@CachCheBien", _CachCheBien));
            DataProvider.NonqueryProc(procname, parr);
            MessageBox.Show("Cập nhật thành công", "Thông báo");
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
